package com.student.service.impl;

import com.student.mapper.XueShengMapper;
import com.student.model.XueSheng;
import com.student.service.XueShengService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class XueShengServiceImpl implements XueShengService {

        @Autowired
        private XueShengMapper xueShengMapper;

       @Override
        public XueSheng getXueShengById(Integer stuId) {
            XueSheng xueSheng = xueShengMapper.getXueShengById(stuId);
            return xueSheng;
        }

        @Override
        public int insertXueSheng(XueSheng xueSheng) {
            int count = xueShengMapper.insertXueSheng(xueSheng);
            return count;
        }

        @Override
        public int deleteXueShengById(Integer stuId) {
            int count = xueShengMapper.deleteInforById(stuId);
            return count;
        }

        @Override
        public int batchInsertXueShengs(List<XueSheng> list) {
            return 0;
        }

        @Override
        public int batchDeleteStudents(List<Integer> list) {
            return 0;
        }

        @Override
        public List<XueSheng> getAllXueSheng() {
            return xueShengMapper.getAllXueSheng();
        }

        @Override
        public int updateXueShengInfo(XueSheng xueSheng) {
            int count = xueShengMapper.updateXueShengInfo(xueSheng); // 确保括号正确
            return count;
        }

        // 确保XueShengMapper接口中有此方法的实现
        @Override
        public List<XueSheng> getAllXueShengClassInfo() {
            return xueShengMapper.getAllXueShengClassInfo();
        }

        @Override
        public List<XueSheng> getXueShengsByClassId(Integer classId) {
            return xueShengMapper.getXueShengsByClassId(classId);
        }
    }

